package ru.amse.baltijsky.javascheme;

import ru.amse.baltijsky.javascheme.io.importer.IImporterFactory;
import ru.amse.baltijsky.javascheme.io.importer.IImporter;
import ru.amse.baltijsky.javascheme.io.importer.ImporterFactory;

/**
 * Overrides default factory returning java 1.5 parser.
 */
public class Java15ImporterFactory implements IImporterFactory {
    private ImporterFactory importerFactory;

    public Java15ImporterFactory() {
        importerFactory = new ImporterFactory();
    }

    public IImporter createImporter(String alias) throws IllegalArgumentException {
        if(alias.equalsIgnoreCase("java")) {
            return new ru.amse.baltijsky.javascheme.io.importer.sablecc.java15.SableCCImporter();
        } else {
            return importerFactory.createImporter(alias);
        }
    }
}
